<template>
  <div id="check-card">
    <div class="check-loading">
      <van-loading
              type="spinner"
              size="42px"
              text-size="13px;"
              vertical
        >加载中...</van-loading
      >
    </div>
  </div>
</template>

<script>
import { getSSCApplyInfo } from "@/apis/test";

export default {
  created() {
    this.initData();
  },
  methods: {
    initData() {
      this.checkCard();
    },
    async checkCard() {
      let res = await getSSCApplyInfo();
      this.$store.dispatch("user", res.data);
      if (this.modelFunctions.httpTip(res)) {
        if (
          res.data &&
          (res.data.signFlag === "0" || res.data.signFlag === "2")
        ) {
          this.$router.replace("/bind");
        } else if (res.data && res.data.signFlag === "1") {
          console.log("已领卡");
          this.$router.replace("/code");
          // this.$router.replace("/bind");
        }
      }
    }
  }
};
</script>

<style lang="less" scoped>
#check-card {
  width: 100%;
  height: 100%;
  position: relative;

  .check-loading {
    position: absolute;
    top: 40%;
    left: 50%;
    transform: translate(-50%, -40%);
  }
}
</style>
